//
//  NSDictionary+Null.m
//  FoundationLibs
//
//  Created by 唐可雄 on 16/9/22.
//  Copyright © 2016年 swustyc. All rights reserved.
//

#import "NSDictionary+Null.h"

@implementation NSDictionary (Null)

- (id)valueDefaultNilForKey:(NSString *)key {
    if ([key isKindOfClass:[NSString class]]) {
        id value = [self valueForKey:key];
        if ([value isKindOfClass:[NSNull class]]) {
            return nil;
        } else {
            return value;
        }
    } else {
        return nil;
    }
}

@end
